<template>
  <div class="flex flex-wrap gap-4">
    <el-card style="width: 200px" shadow="always" v-button="['api:none:home:pendingapprovecount']">
      <template #header>待审批</template>
      <p>{{ pendingApproveCount }}</p>
    </el-card>
    <el-card style="width: 200px" shadow="always" v-button="['api:none:home:approvedcount']">
      <template #header>已审批</template>
      <p>{{ approvedCount }}</p>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import HomeApi from "@/api/home";

const pendingApproveCount = ref();
const approvedCount = ref();
onMounted(async () => {
  pendingApproveCount.value = await HomeApi.pendingApproveCount();
  approvedCount.value = await HomeApi.approvedCount();
});
</script>
